package com.acmen.easyapi.model;

import java.util.ArrayList;
import java.util.List;

public class MenuTree {
    /**
     * 菜单名
     */
    private String name;

    private String apiId;
    /**
     * 接口ID
     */
    private String url;
    /**
     * 接口路径
     */
    private String path;
    /**
     * 子菜单
     */
    private List<MenuTree> childrens;

    private String sortIndex = "ZZZ9999";

    public MenuTree(String name) {
        this.name = name;
        childrens = new ArrayList<>();
    }

    public MenuTree(String name, String url) {
        this.name = name;
        this.url = url;
        childrens = new ArrayList<>();
    }

    public MenuTree(String name, String apiId, String url, String path, String sortIndex) {
        this.name = name;
        this.apiId = apiId;
        this.url = url;
        this.path = path;
        if(sortIndex==null){
            sortIndex = "ZZZ9999";
        }
        this.sortIndex = sortIndex;
        childrens = new ArrayList<>();
    }

    public String getName() {
        return name;
    }

    public MenuTree setName(String name) {
        this.name = name;
        return this;
    }

    public String getApiId() {
        return apiId;
    }

    public MenuTree setApiId(String apiId) {
        this.apiId = apiId;
        return this;
    }

    public String getUrl() {
        return url;
    }

    public MenuTree setUrl(String url) {
        this.url = url;
        return this;
    }

    public String getPath() {
        return path;
    }

    public MenuTree setPath(String path) {
        this.path = path;
        return this;
    }

    public List<MenuTree> getChildrens() {
        return childrens;
    }

    public MenuTree setChildrens(List<MenuTree> childrens) {
        this.childrens = childrens;
        return this;
    }

    public String getSortIndex() {
        return sortIndex;
    }

    public MenuTree setSortIndex(String sortIndex) {
        this.sortIndex = sortIndex;
        return this;
    }
}
